<?php
namespace app\index\controller;

use app\BaseController;

use thans\jwt\facade\JWTAuth;
use think\facade\Cache;
use think\facade\Request;

class Login extends BaseController
{
   public function index(){
        dump(233333);exit;
       $data = Request::post();
       $user = [
           'user_id' =>1,
           'username' => 'test',
           'name' => '测试',
           'avatar'=>'asdasd',
           'is_login'=>1,

       ];
       $token = JWTAuth::builder($user);
       $user['token'] = $token;
       Cache::tag('fro_cache')->set('fro_token',$token,86400 * 7);
       return renderSuccess('登录成功',$user);
   }

   public function test(){
       dump('test');exit;
   }

}
